<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@page isELIgnored="false" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<script src="/lzproject/Js/jquery.min.js"></script>
     <link rel="stylesheet" href="/lzproject/CSS/bootstrap.min.css">
    <script src="/lzproject/Js/bootstrap.min.js"></script>
    <style>
        #box{
            width: 900px;
            height: 600px;
            border: 0px solid darkgrey;
            padding: 100px;
        }

    </style>
    
    <script type="text/javascript">
       
    </script>
    
  </head>
  
 <body >
<div id="box">
<h2>编辑事项：</h2>
<br>
<br>
<form role="form" action="/lzproject/sx/add.do" id="form">
    <div class="input-group" class="bs-example bs-example-form">
        <span class="input-group-addon">事项名称</span>
        <input type="text" name="sx_name" class="form-control" >
    </div>
    <br>

    <div class="row">
        <div class="col-lg-6">
            <div class="input-group">
                <div class="input-group-btn">
                    <button type="button" class="btn btn-default
                        dropdown-toggle" data-toggle="dropdown" id="button1">事项类型
                        <span class="caret"></span>
                    </button>
                    <ul id="project" class="dropdown-menu">
                        <li value="1">区级督察事项</li>
                        <li value="2">市级督察事项</li>
                        <li value="3">重点项目</li>
                        <li value="4">中心工作</li>
                       
                    </ul>
                </div><!-- /btn-group -->
                <input type="text" class="form-control" id="proname">
                <input type="hidden" id="pro" name="sx_type_id">
            </div><!-- /input-group -->
        </div><!-- /.col-lg-6 -->
    </div>
     <br>
 
    <div class="input-group" class="bs-example bs-example-form">
        <span class="input-group-addon">事项合作单位</span>
        <input type="text" name="sx_enterprice" class="form-control" >
    </div>
    <br>
    <div class="form-group">
        <label for="name">事项内容</label>
        <textarea class="form-control" rows="3" id="name" name="sx_content"></textarea>
    </div>
   <!-- <button type="button" class="btn btn-primary btn-lg " id="button2">保存事项</button> -->
    <input type="button" class="btn btn-info" id="button2" onclick="insert()" value="保存事项">
</form>
</div>
<script>
    jQuery(function() {
        jQuery(".dropdown-toggle").dropdown('toggle');
    });
    
    jQuery("#project").on("click", "li", function(){
         
        jQuery("#proname").val($(this).text());
        jQuery("#pro").val($(this).attr("value"));
    });

    function insert() {
        $.ajax({
                type:'GET',
                url:'/lzproject/sx/add.do',
                dataType: 'json',
                data: $('#form').serialize(),
                cache:false,
                processData: false,
                contentType: false,
                success: function(data){ 
	                alert(data.msg);
            },
            error: function(obj){
                alert(data.msg);
            },
           });    
    };

</script>
</body>
</html>
